# -*- coding: utf-8 -*-
# @Time    : 2024/9/5 下午9:51
# @Author  : liujun
# @Email   : 2592730854@qq.com
# @File    : class_video_details_page.py
# @Software: PyCharm


from selenium.webdriver.common.by import By
class ClassVideoDetailsPage:

    #收藏按钮
    collections_btn_locator=(By.XPATH,"//android.view.View[@content-desc=\"收藏\"]")

    #点击播放视频
    play_btn_locator=(By.XPATH,'//android.view.View[@content-desc="开篇概述 试看 03:02"]')


    def __init__(self,driver):
        self.driver = driver

    def click_collections_btn(self): #点击收藏按钮
        self.driver.find_element(*self.collections_btn_locator).click()

    def collection_txt(self):  #获取收藏文本
        return self.driver.find_element(*self.collections_btn_locator).text.strip()

    def click_play_btn(self):  #点击播放视频
        self.driver.find_element(*self.play_btn_locator).click()


